package com.cn.ysf.newbeemall.service.Impl;

import com.cn.ysf.newbeemall.mapper.AdminUserMapper;
import com.cn.ysf.newbeemall.pojo.AdminUser;
import com.cn.ysf.newbeemall.service.AdminUserService;
import com.cn.ysf.newbeemall.util.MD5Util;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author ysf
 * @date 2019/12/12 19:33
 */
@Service
public class AdminUserServiceImpl implements AdminUserService {


    @Resource
    private AdminUserMapper adminUserMapper;

    /**
     * 用户登陆方法
     * @param userName
     * @param password
     * @return
     */
    @Override
    public AdminUser login(String userName, String password) {
        //将密码加密
        String passwordMd5 = MD5Util.MD5Encode(password, "UTF-8");
        return adminUserMapper.login(userName, passwordMd5);
    }
}
